package com.axjy.mapper;

import com.axjy.dto.InspectiontaskDetailDto;
import com.axjy.dto.InspectiontaskMainDto;
import com.axjy.pojo.InspectiontaskDetail;
import com.axjy.pojo.InspectiontaskMain;
import com.axjy.pojo.LineInfo;
import com.axjy.pojo.Systemconfig;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * Created by 00 on 2018/2/3.
 */
public interface InspectiontaskDetailMapper {
    public List<InspectiontaskDetail> djqrshow(@Param("offset") Integer offset, @Param("limit") Integer limit,@Param("dto") InspectiontaskDetailDto dto);

    public Integer getCount(@Param("dto") InspectiontaskDetailDto dto);

    public List<Systemconfig> getBybug();

    public List<InspectiontaskDetail> zxshow(@Param("offset") Integer offset, @Param("limit") Integer limit,@Param("dto") InspectiontaskMainDto dto);

    public Integer getCount2(@Param("dto") InspectiontaskMainDto dto);

    public List<InspectiontaskDetail> qxshow(@Param("offset") Integer offset, @Param("limit") Integer limit,@Param("dto") InspectiontaskMainDto dto);

    public Integer getCount3(@Param("dto") InspectiontaskMainDto dto);

    /**
     * 查询系统配置
     * @return
     */
    public List<LineInfo> search(String lineCode);

    /**
     * 联动
     * @param configCode
     * @return
     */
    public List<InspectiontaskDetail> getByCode(String configCode);



    @Update("UPDATE inspectiontask_detail SET bug_Level_Name=#{bugLevelName},bug_Level=#{bugLevel},bug_Type=#{bugType},bug_Type_Name=#{bugTypeName},intact_Rate=#{intactRate} where pole_Code=#{poleCode}")
    public void hzupdate(InspectiontaskDetail inspectiontaskDetail);

    @Select("SELECT * FROM systemconfig WHERE config_Name='缺陷类型'")
    public List<Systemconfig> search1();

    @Select("SELECT * FROM systemconfig WHERE config_Name='缺陷级别'")
    public List<Systemconfig> search2();

    @Update("UPDATE inspectiontask_main SET task_Status=3,task_Status_Name='执行中' where Id=#{Id}")
    public void zxupdate(Integer id);

    @Update("UPDATE inspectiontask_main SET task_Status=4,task_Status_Name='已完成' where Id=#{taskId}")
    public void hzwcupdate(Integer taskId);

}
